; *** Neutron
; *** Copyright 1998-2002 Zillions Development
; v.2.0

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com
(translate
("Neutron 5x5" "中子棋5x5")("Neutron 7x7" "中子棋7x7")
("Co-Neutron 5x5" "反中子棋5x5")("Co-Neutron 7x7" "反中子棋7x7")
)

(define max-slide
  ($1 (verify empty?) (while (empty? $1) $1) add)
)

(game
   (title "Neutron 5x5")
   (description "每方持有一排兵。棋盘正中间的黄色棋子是中子，不属于任何一方。\\
      所有棋子均可向八个方向移动，但必须移动到无法再继续向那个方向移动（即撞墙或撞到其他棋子）为止。\
每一个回合，玩家先移动中子，再移动自己的兵。但是先手第一回合不移动中子。\
把中子移到自己底线为胜（即使是由对方移到的）。无法移动者输棋。")
   (history "Neutron was invented by Robert A. Kraus and published in issue 71 of
      the English magazine `Games & Puzzles` in July/August 1978.  Italian players
      E. Neri and R. Baldassarri analyzed the 5x5 game as a win for White, and
      recommended playing on the 7x7 board.  Mark Owen and Julian Richardson of
      Cambridge University suggested a reversed version of Neutron, which they
      call CoNeutron, in which the object is to get the Neutron to your opponent's
      back row (or to stalemate the opponent as usual).")
   (strategy "Try to restrict your opponent's mobility by crowding him.  At the
      same time, try to vacate your back row while keeping your opponent's back
      row occupied.  Maneuver the Neutron towards your own back row.")
   (option "prevent flipping" 2)
   (move-sound "Audio\\AlienPedal.wav")
   (win-sound "Audio\\AlienWavery.wav")
   (loss-sound "Audio\\AlienWavery.wav")
   (opening-sound "Audio\\AlienChord.wav")
   (release-sound "Audio\\Glurp.wav")
   (players White Black Neutral)
   (turn-order White repeat (Black Neutral) Black (White Neutral) White)

   (board
      (image "images\Chess\SHaag\chess5x5.bmp"
             "images\Chess\SHaag\chess5x5.bmp"
	     "images\Chess\chess5x5.bmp"
	     "images\Chess\chess5x5.bmp")
      (grid
         (start-rectangle 5 5 53 53)
         (dimensions
             ("a/b/c/d/e" (49 0)) ; files
             ("5/4/3/2/1" (0 49)) ; ranks
         )
         (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0)
			         (ne 1 -1) (nw -1 -1) (se 1 1) (sw -1 1)
         )
      )
      (symmetry Black (n s)(s n) (nw sw)(sw nw) (ne se)(se ne))
      (zone
         (name win-zone)
         (players White)
         (positions a1 b1 c1 d1 e1)
      )
      (zone
         (name win-zone)
         (players Black)
         (positions a5 b5 c5 d5 e5)
      )
      (zone
         (name win-zone2)
         (players White)
         (positions a5 b5 c5 d5 e5)
      )
      (zone
         (name win-zone2)
         (players Black)
         (positions a1 b1 c1 d1 e1)
      )
   )

   (board-setup
      (White
         (Pawn a1 b1 c1 d1 e1)
      )
      (Black
         (Pawn a5 b5 c5 d5 e5)
      )
      (Neutral
         (Neutron c3)
      )
   )

   (piece
      (name Pawn)
	  (help "兵：八方移动，撞到为止")
	  (description "兵\可以向八个方向移动，必须移动到无法再移动，即撞墙或撞到其他棋子为止。不吃子。")
      (image White "images\Neutron\NeutronWPawn.bmp" "images\Neutron\NeutronWPawn2.bmp"
             Black "images\Neutron\NeutronBPawn.bmp" "images\Neutron\NeutronBPawn2.bmp")
      (moves
         (max-slide n)
         (max-slide e)
         (max-slide s)
         (max-slide w)
         (max-slide ne)
         (max-slide nw)
         (max-slide se)
         (max-slide sw)
      )
   )
   (piece
      (name Neutron)
	  (help "中子：八方移动，撞到为止")
	  (description "中子\可以向八个方向移动，但必须移动到无法再移动，即撞墙或撞到其他棋子为止。不吃子。")
      (image Neutral "images\Neutron\Neutron.bmp")
	  (moves
         (max-slide n)
         (max-slide e)
         (max-slide s)
         (max-slide w)
         (max-slide ne)
         (max-slide nw)
         (max-slide se)
         (max-slide sw)
      )
   )
   (win-condition (White Black)
	  	  (absolute-config (any-owner Neutron) (win-zone))
   )
   (loss-condition (White Black) stalemated)
)


(define Board-7x7
   (board
      (image "images\Chess\SHaag\chess7x7.bmp"
	     "images\Chess\SHaag\chess7x7.bmp"
	     "images\Chess\chess7x7.bmp"
	     "images\Chess\chess7x7.bmp")
      (grid
         (start-rectangle 5 5 53 53)
         (dimensions
             ("a/b/c/d/e/f/g" (49 0)) ; files
             ("7/6/5/4/3/2/1" (0 49)) ; ranks
         )
         (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0)
			         (ne 1 -1) (nw -1 -1) (se 1 1) (sw -1 1)
         )
      )
      (symmetry Black (n s)(s n) (nw sw)(sw nw) (ne se)(se ne))
      (zone
         (name win-zone)
         (players White)
         (positions a1 b1 c1 d1 e1 f1 g1)
      )
      (zone
         (name win-zone)
         (players Black)
         (positions a7 b7 c7 d7 e7 f7 g7)
      )
      (zone
         (name win-zone2)
         (players Black)
         (positions a1 b1 c1 d1 e1 f1 g1)
      )
      (zone
         (name win-zone2)
         (players White)
         (positions a7 b7 c7 d7 e7 f7 g7)
      )
   )
   (board-setup
      (White
         (Pawn a1 b1 c1 d1 e1 f1 g1)
      )
      (Black
         (Pawn a7 b7 c7 d7 e7 f7 g7)
      )
      (Neutral
         (Neutron d4)
      )
   )
)

(define Co-Neutron-Common
   (description "每方持有一排兵。棋盘正中间的黄色棋子是中子，不属于任何一方。\\
      所有棋子均可向八个方向移动，但必须移动到无法再继续向那个方向移动（即撞墙或撞到其他棋子）为止。\
每一个回合，玩家先移动中子，再移动自己的兵。但是先手第一回合不移动中子。\\
反中子棋是把中子移到对方底线为胜（即使是由对方移到的）。无法移动者输棋。")
   (strategy "Try to restrict your opponent's mobility by crowding him, while
      maneuvering the Neutron towards your opponent's home row.  You may be able
	  to herd the Neutron into a position where the opponent has to move it into
	  his own home row.\\
	  The safest strategy may be to keep your Pawns where they are, since they
	  already shield your home row from the Neutron.  However, then your opponent
	  can easily draw against you by adopting the same strategy.  We recommend
	  that you instead play for the win.")
   (turn-order (White Neutral) White (Black Neutral) Black)
   (win-condition (White Black)
	  	  (absolute-config (any-owner Neutron) (win-zone2))
   )
   (loss-condition (White Black) stalemated)
)


(variant
   (title "Neutron 7x7")
   (Board-7x7)
)

(variant
   (title "-") ; --------------------------------------------------------
)

(variant
   (title "Co-Neutron 5x5")
   (Co-Neutron-Common)
)

(variant
   (title "Co-Neutron 7x7")
   (Co-Neutron-Common)
   (Board-7x7)
)